#include<iostream>
#include<stdio.h>
#include<cstring>
using namespace std;
const int N = 260;
char s[N];

int main()
{
	cin >> s;
	for (int i = 0; i < strlen(s); ++i)
	{
		if (s[i] == 'A')
		{
			cout.put('T');
			continue;
		}
		else if (s[i] == 'T')
		{
			cout.put('A');
			continue;
		}
		else if (s[i] == 'C')
		{
			cout.write("G", 1);
			continue;
		}
		else if (s[i] == 'G')
		{
			cout.write("C", 1);
			continue;
		}
	}

	return 0;
}